SortPicts is an entertaining application which demonstrates how easy it is to use threads within your application.
There are a couple of gotcha's with the build process:
• If your version of MetroWerks is earlier than 1.1, you may need to rebuild the projects yourself. If that's the case, you'll find the complete listing of included files and settings at the bottom of this document.
• If you are building with Think-C, you will need to construct your own projects. In that case, you'll want to follow the advice at the bottom of this document regarding building a SortPicts project.
• Various MPW versions and headers may cause you random headaches. The supplied version of SortPicts sources were built with the 3.4a7 MPW Shell from ETO #16 along with the headers from that release. If you are using a different version, you may experience problems.
Making a SortPicts project.
The following files were included to make the SortPicts projects:
For both 68K & PPC:
SortPictsApp.cp
SortPicts.cp
SortPicts2.cp
SortPicts3.cp
SortPicts4.cp
SortPicts5.cp
SortPictsThreads.cp
HeapSort.cp
QuickSort.cp
ShellSort.cp
AppleEventHandling.cp
SprocketMain.cp
DialogUtils.cp
Preferences.cp
SplashWindow.cp
Window.cp
SortPicts.rsrc
Sprocket.rsrc
For 68K the following libraries were used:
ANSI (4i) C.68K.Lib
CPlusPlus.lib
MacOS.lib
For PPC the following libraries were used:
InterfaceLib
ANSI C.PPC.Lib
MWCRuntime.Lib
AOCELib -- Weak link
DragLib -- Weak link
ThreadsLib -- Weak link
There is a precompiled file that will greatly enhance your build time if you go ahead and precompile it. The file is located in the "Precompiled Headers" folder. It is a .cp file and will build under MetroWerks correctly. If you don't already know, you'll need to build two files, one for 68K and one for PPC. The names that we suggest (like, we used these names in the supplied projects) are SortPictsPrecompileMW68K and SortPictsPrecompileMWPPC. Although, you're free to make them Cat and Mouse. We really don't care.
The following "settings" were used to build the file:
Language Settings:
Activate C++ Compiler
Require Function Prototypes
Enable MPW Pointer Type Rules
<Don't forget the beauty of precompiled headers!>
Warnings:
Turn all the warnings on -- that's just good advice
Compiler:
4 byte ints
Small Code Model
68K Struct Alignment, even with the PPC version
68020 code generation, not with the PPC version ;-)
Peephole Optimizer
CSE Optimizer
Linker Options:
Use SYM file generation only if you need it ... if you find a bug, you might think to let me know -- Random
Project:
Build an application
Call it Cat, Mouse, or SortPicts68K or SortPictsPPC -- one or the other, MPW builds "SortPicts"
Creator 'RnDm', type 'APPL'
Prefered heap size 2000K, minimum heap size 1000K
Other SIZE resource options:
dontSaveScreen,
acceptSuspendResumeEvents,
enableOptionSwitch,
canBackground, /* Can properly use background null events */
doesActivateOnFGSwitch, /* We do our own activate/deactivate; don't fake us out */
backgroundAndForeground, /* This is definitely not a background-only application! */
dontGetFrontClicks, /* Change this is if you want "do first click" behavior like the Finder */
ignoreAppDiedEvents, /* Essentially, I'm not a debugger (sub-launching) */
is32BitCompatible, /* This app can be run in 32-bit address space */
isHighLevelEventAware, /* does Post/AcceptHighLevelEvent */
localAndRemoteHLEvents,
notStationeryAware,
dontUseTextEditServices
No additional access paths were necessary for this build.
For the PowerPC version, the following additional steps may be helpful:
There were no variations on the default settings for a PPC build file: